/**
 * Created by chesw on 2017/5/10.
 */
(function () {
    new Vue({
        el: '#personal-center',
        data: {
            leftTab: {
                title: '个人中心',
                tabList: [
                    {
                        list: [
                            { name: '我的预约', cls: GlobalValue.VALIDTAB, id: Personal.PATIENTAPPOINT },
                            { name: '我的病例', cls: GlobalValue.INVALIDTAB, id: Personal.CASESLIST },
                            { name: '我的就诊人', cls: GlobalValue.INVALIDTAB, id: Personal.MYDIAGNOSIS }
                        ]
                    },
                    { list: [{ name: '个人资料设置', cls: GlobalValue.INVALIDTAB, id: Personal.PERSONALINFO }] }
                ]
            },
            showConfirm: false,
            showMid: Personal.CASESDETAIL, //0: 我的预约人, 1：我的病例， 2：病例详情，3：我的就诊人
            confirm: {}
        },
        mounted: function () {
            showHtml();
        },
        components: {
            'clinic-head': clinicHead,
            'clinic-right': clinicRight,
            'clinic-foot': clinicFoot,
            'clinic-left-tab': clinicLeftTab,
            'patient-appoint': patientAppoint,
            'cases-list': casesList,
            'my-diagnosis': myDiagnosis,
            'personal-info': personalInfo,
            'case-detail': caseDetail,
            'clinic-page': clinicPage,
            'dialog-confirm': dialogConfirm
        },
        methods: {
            changeTab: function (p_param) {
                this.showMid = p_param.id;
                this.leftTab = changeColorByLNav(this.leftTab, p_param.first, p_param.second);
            },
            confirmDialog: function (p_val) {
                if (p_val.type) {
                    this.confirm = p_val;
                } else {
                    this.leftTab = changeColorByLNav(this.leftTab, 0, 1);
                    this.showMid = Personal.CASESLIST;
                }
            },
            showMyDiag: function (p_val) {
                //导航到“我的就诊人"
                this.leftTab = changeColorByLNav(this.leftTab, 0, 2);
                this.showMid = p_val;
            },
            detail: function (p_val) {
                this.showMid = p_val;
            }
        }
    })
})()